package com.jctrip.hotel.source.xxl.rezen;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import com.jctrip.hotel.common.constant.XxlJobNameConstant;
import com.jctrip.hotel.source.service.rezen.RezenTaskService;
import com.xxl.job.core.context.XxlJobHelper;
import com.xxl.job.core.handler.IJobHandler;
import com.xxl.job.core.handler.annotation.XxlJob;

import lombok.extern.slf4j.Slf4j;

/**
 * @Author henry
 * @Date 2023/8/12 15:48
 * @Description
 */
@Component
@Slf4j
public class SyncRezenRatesTaskPushXxlJob extends IJobHandler {
    @Resource
    private RezenTaskService rezenTaskService;

    @Override
    @XxlJob(XxlJobNameConstant.SYNC_REZEN_RATES_PUSH)
    public void execute() throws Exception {
        XxlJobHelper.log(XxlJobNameConstant.SYNC_REZEN_RATES_PUSH + " xxl job start");
        try {
            rezenTaskService.syncRezenRatesTaskPush();
        } catch (Exception e) {
            log.error(XxlJobNameConstant.SYNC_REZEN_RATES_PUSH + "error", e);
        }
        XxlJobHelper.log(XxlJobNameConstant.SYNC_REZEN_RATES_PUSH + " xxl job start");

    }
}
